import re

input_file_path = "test.txt"
output_file_path = "filtered_output.txt"
pattern = r'\bCourant number mean\b'

with open(input_file_path, 'r') as input_file, open(output_file_path, 'w') as output_file:
    # 使用正则表达式匹配行
    matching_lines = [line.strip() for line in input_file if re.search(pattern, line) and 'Interface' not in line]

    # 写入到输出文件
    output_file.write('\n'.join(matching_lines))

